ClampLayout

A layout manager constraining its children to a given size.

<picture> <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-wide.png" alt="clamp-wide"> </picture> <picture> <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-narrow.png" alt="clamp-narrow"> </picture>

AdwClampLayout constraints the size of the widgets it contains to a given maximum size. It will constrain the width if it is horizontal, or the height if it is vertical. The expansion of the children from their minimum to their maximum size is eased out for a smooth transition.

If a child requires more than the requested maximum size, it will be allocated the minimum size it can fit in instead.

Each child will get the style classes .large when it reached its maximum size, .small when it's allocated the full size, .medium in-between, or none if it hasn't been allocated yet.

Constructors

this
this(AdwClampLayout* adwClampLayout, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new AdwClampLayout.

Members

Functions

getClampLayoutStruct
AdwClampLayout* getClampLayoutStruct(bool transferOwnership)

Get the main Gtk struct

getMaximumSize
int getMaximumSize()

Gets the maximum size allocated to the children.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTighteningThreshold
int getTighteningThreshold()

Gets the size above which the children are clamped.

setMaximumSize
void setMaximumSize(int maximumSize)

Sets the maximum size allocated to the children.

setTighteningThreshold
void setTighteningThreshold(int tighteningThreshold)

Sets the size above which the children are clamped.

Mixins

__anonymous
mixin OrientableT!(AdwClampLayout)
Undocumented in source.

Static functions

getType
GType getType()

Variables

adwClampLayout
AdwClampLayout* adwClampLayout;

the main Gtk struct

Mixed In Members

From mixin OrientableT!(AdwClampLayout)

getOrientableStruct
GtkOrientable* getOrientableStruct(bool transferOwnership)

Get the main Gtk struct

getOrientation
GtkOrientation getOrientation()

Retrieves the orientation of the @orientable.

setOrientation
void setOrientation(GtkOrientation orientation)

Sets the orientation of the @orientable.

Inherited Members

From LayoutManager

gtkLayoutManager
GtkLayoutManager* gtkLayoutManager;

the main Gtk struct

getLayoutManagerStruct
GtkLayoutManager* getLayoutManagerStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
allocate
void allocate(Widget widget, int width, int height, int baseline)

Assigns the given @width, @height, and @baseline to a @widget, and computes the position and sizes of the children of the @widget using the layout management policy of @manager.

getLayoutChild
LayoutChild getLayoutChild(Widget child)

Retrieves a GtkLayoutChild instance for the GtkLayoutManager, creating one if necessary.

getRequestMode
GtkSizeRequestMode getRequestMode()

Retrieves the request mode of @manager.

getWidget
Widget getWidget()

Retrieves the GtkWidget using the given GtkLayoutManager.

layoutChanged
void layoutChanged()

Queues a resize on the GtkWidget using @manager, if any.

measure
void measure(Widget widget, GtkOrientation orientation, int forSize, int minimum, int natural, int minimumBaseline, int naturalBaseline)

Measures the size of the @widget using @manager, for the given @orientation and size.

From OrientableIF

getOrientableStruct
GtkOrientable* getOrientableStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getOrientation
GtkOrientation getOrientation()

Retrieves the orientation of the @orientable.

setOrientation
void setOrientation(GtkOrientation orientation)

Sets the orientation of the @orientable.

Meta